<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
    var num1,num2,result,answer;
    while(true){
        num1 = Math.floor(Math.random()*9)+1;
        num2 = Math.floor(Math.random()*9)+1;
        result = num1 + num2;
        answer = prompt(num1 + "+" + num2 + "=","0");
        if(answer != null){
            if(!confirm(((answer == result) ? "正确" : "错误") + "！是否继续？")){
                break;
            }
        }else{
            break;
        }
    }
</script>
</body>
</html>
